package com.chinasoft.movies.controller;

import com.chinasoft.movies.pojo.GenreRankInVote;
import com.chinasoft.movies.service.GenreRankInVoteService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Log4j2
@CrossOrigin
public class GenreRankInVoteController {

    @Autowired
    GenreRankInVoteService genreRankInVoteService;

    //查询平均评分前十的类型的 类型名、平均评分
    @GetMapping("/queryGenreRankInVote")
    public List<GenreRankInVote> queryGenreRankInVote(){
        List<GenreRankInVote> result = genreRankInVoteService.queryGenreRankInVote();
        return result;
    }
}
